//
//  HEDoctorCommentHeadCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/17.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEDoctorCommentHeadCell.h"

@interface HEDoctorCommentHeadCell ()

@property (nonatomic, strong) UILabel *titleLb;


@end

@implementation HEDoctorCommentHeadCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    self.contentView.backgroundColor = CViewBgColor;

    UIView *warp = [UIView new];
    warp.backgroundColor = KWhiteColor;
    [self.contentView addSubview:warp];

    [warp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView);
        make.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView);
    }];
    
    // 姓名
    _titleLb = [UILabel new];
    _titleLb.text = @"患者评价（999+）";
    _titleLb.font = DYBlodFont(18);
    [warp addSubview:_titleLb];
    
    QMUIButton *check = [[QMUIButton alloc] init];
    check.imagePosition = QMUIButtonImagePositionRight;// 将图片位置改为在文字下方
    check.tintColorAdjustsTitleAndImage = CNavSubTitleColor;
    check.adjustsImageTintColorAutomatically = NO;
    check.spacingBetweenImageAndTitle = 10;
    [check setImage:UIImageMake(@"go_gray") forState:UIControlStateNormal];
    [check setTitle:@"全部" forState:UIControlStateNormal];
    check.titleLabel.font = DYFont(15);
    [warp addSubview:check];
    check.userInteractionEnabled = NO;
//    [check addTarget:self action:@selector(checkCommetClick) forControlEvents:UIControlEventTouchUpInside];
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(warp).mas_offset(15);
        make.left.equalTo(warp).mas_offset(15);
        make.bottom.equalTo(warp).mas_offset(-15);
    }];
    
    [check mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_titleLb);
        make.right.equalTo(warp).mas_offset(-15);
    }];
}

- (void)refreshContent:(GDFiterCellModel *)fiterModel formModel:(GDFormModel *)formModel indexPath:(NSIndexPath *)indexPath {
    _titleLb.text = [NSString stringWithFormat:@"患者评价（%@）", [NSString moreThanToPlus:formModel.doc_totalCommet max:999]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
